/*
 * AGENT SHERPA
 *  
 * Assignement 2 of the Agent Oriented Software Engineering Course
 * M.Sc. in Advanced Software Engineering (Part-time)
 * University College Dublin www.ucd.ie
 *
 * Copyright (c) 2007 Chris Walsh, Aidan Morrisy and Iain Hull.
 * All rights reserved.
 */

package org.agentsherpa;

/**
 * Adds map data belief when Drone is to send map data to the Control agent.
 * @author iain
 */
public class MapMessagePerceptor extends BasePerceptor {

	@Override
	public void perceive() {
		try {
			LocationModule module = getLocationModule();
			if (module.shouldSendMapUpdate()) {
				String data = module.mapDataUpdate();
				System.out.println(data);
				adoptBelief("BELIEF(mapData(\"" + data + "\"))");
			}
			else {
				adoptBelief("BELIEF(mapdataToBeSent(" + module.mapDataToBeSent() + "))");
			}
			
		}
		catch (PerceptorException e) {
			e.printStackTrace();
		}
	}
}
